/*
 * @Author: Kingsley
 * @Date: 2018-10-22 21:50:36
 * @Last Modified by: mikey.zhaopeng
 * @Last Modified time: 2018-10-24 22:20:40
 * 我的账单模块的service接口定义
 */

import _axios from "@/utils/requestUtil";
import _urlConfig from "@/config/bill/AccountURLConfig";

class Account {
  /**
   * 1.新增我的账单记录信息
   * @param {} addAccountData
   * {
   *    createTime:该账单的所属时间
   *    fkGoodsId:加工零件的id，必填
   *    quantity:加工零件的数量，必填
   *    enableStatus:账单的状态：1：未结算，2：已结算
   *    description:这条账单的备注描述，非必填
   * }
   */
  addAccount(addAccountData) {
    return _axios.request({
      url: _urlConfig.addAccount,
      data: addAccountData,
      method: "post"
    });
  }

   /**
   * 1.新增我的账单记录信息
   * @param {} addAccountData
   * {
   *    createTime:该账单的所属时间
   *    price:加工零件单价必填
   *    quantity:加工零件的数量，必填
   *    enableStatus:账单的状态：1：未结算，2：已结算
   *    description:这条账单的备注描述，非必填
   * }
   */
  addAccountNotGoods(addAccountData){
    return _axios.request({
      url: _urlConfig.addAccountNotGoods,
      data: addAccountData,
      method: "post"
    });
  }

  /**
   * 2.根据搜索的时间范围获取个人的账单信息
   * @param {*} requestParam
   * {
   *     timestamps:搜索的时间戳
   *    pageNum : 当前的页数,默认值为1
   *    pageSize：当前页面大小，默认为10
   * }
   */
  getAccounts(requestParam) {
    return _axios.request({
      url: _urlConfig.getAccounts,
      data: requestParam,
      method: "post"
    });
  }

  /**
   *
   * @param {*} requestParam
   * {
   *    timestamps:搜索的时间戳
   * }
   */
  getStatisticalInfo(requestParam) {
    return _axios.request({
      url: _urlConfig.getStatisticalInfo,
      data: requestParam,
      method: "post"
    });
  }

  /**
   * 趋势图数据
   * @param {*} requestParam 
   */
  getLineData(requestParam) {
    return _axios.request({
      url: _urlConfig.getLineData,
      data: requestParam,
      method: "post"
    });
  }

  /**
   * 
   * @param {*} requestParam 
   * id:待删除账单的id
   */
  deleteAccount(requestParam){
    return _axios.request({
      url: _urlConfig.deleteAccount,
      data: requestParam,
      method: "post"
    });
  }


     /**
   * 1.新增我的账单记录信息
   * @param {} requestParam
   * {
   *    createTime:该账单的所属时间
   *    price:加工零件单价必填
   *    quantity:加工零件的数量，必填
   *    enableStatus:账单的状态：1：未结算，2：已结算
   *    description:这条账单的备注描述，非必填
   *    id：主键
   * }
   */
  editNotGoods(requestParam){
    return _axios.request({
      url: _urlConfig.editNotGoods,
      data: requestParam,
      method: "post"
    });
  }
}
export default Account;
